 #include<bits/stdc++.h>
 using namespace std;
 int main(){
	freopen("color,in","r",stdin);
	freopen("color,out","w",stdout);
	int T,n,a[18];
	cin>>T;
	while(T--){
        cin>>n;
        for(int i=0; i<n; i++){
            cin>>a[i];
        }
	}
	cout<<1<<endl;
	cout<<0<<endl;
	cout<<8<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
 }
